const funcCallReplace = {
    FunctionDeclaration(path){
        let {node,scope} = path;
        // 1. 拿到body
        let body = node.body.body;
        // 2. 判断body的第一条是否为VariableDeclaration
        if (body.length === 0 || body[0].type !== 'VariableDeclaration' || body[0].declarations.length ===0) return
        let declaration = body[0].declarations[0];
        if (declaration.init === undefined || declaration.init.name !== '_0x4f09') return
        let varName = declaration.id.name
        console.log(node.id.name)
        console.log(varName)
        // 3. 获取所有引用
        let bindingPathList = getAllBindingInfo(varName,scope);
        console.log(bindingPathList)
        for (let referPath of bindingPathList) {
            // 获取参数,执行函数,替换内容
            let args = referPath.node.arguments;
            if (args === undefined ||args.length !== 1){
                continue
            }
            let argValue = referPath.node.arguments[0].extra.raw;
            console.log(argValue)
            referPath.replaceWith(types.valueToNode(_0x4f09(argValue)))
        }
    }
}

traverse(ast, funcCallReplace);
